<template>
  <view class="game-play">
    <view class="game-header">
      <view class="room-info">房间号: {{ roomInfo.roomNo }}</view>
    </view>
    
    <view class="game-container">
      <view class="game-content">
        <text class="placeholder-text">游戏逻辑待开发...</text>
        <text class="info-text">4人已就位，游戏即将开始</text>
      </view>
    </view>
    
    <view class="game-footer">
      <button class="btn-exit" @click="exitGame">退出游戏</button>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      roomId: '',
      roomInfo: {
        roomNo: ''
      }
    }
  },
  
  onLoad(options) {
    this.roomId = options.roomId
    this.loadGameInfo()
  },
  
  methods: {
    async loadGameInfo() {
      // TODO: 加载游戏信息
      this.roomInfo.roomNo = this.roomId
    },
    
    exitGame() {
      uni.showModal({
        title: '提示',
        content: '确定要退出游戏吗？',
        success: (res) => {
          if (res.confirm) {
            uni.navigateBack({
              delta: 2
            })
          }
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.game-play {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  display: flex;
  flex-direction: column;
}

.game-header {
  padding: 30rpx;
  background: rgba(255, 255, 255, 0.1);
  
  .room-info {
    font-size: 28rpx;
    color: #fff;
    text-align: center;
  }
}

.game-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40rpx;
}

.game-content {
  text-align: center;
  
  .placeholder-text {
    display: block;
    font-size: 48rpx;
    color: #fff;
    font-weight: bold;
    margin-bottom: 30rpx;
  }
  
  .info-text {
    display: block;
    font-size: 28rpx;
    color: rgba(255, 255, 255, 0.7);
  }
}

.game-footer {
  padding: 30rpx;
  
  .btn-exit {
    width: 100%;
    height: 88rpx;
    line-height: 88rpx;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 32rpx;
    border-radius: 44rpx;
    border: 2rpx solid rgba(255, 255, 255, 0.3);
  }
}
</style>
